﻿using UnityEngine;
using System.Collections;

public class JellyFish : MonoBehaviour {
	public Transform sunrise;
	public Transform sunset;
	public float journeyTime = 1.0F;
	private float startTime;
	public GameObject puffer;
	public Vector3 mypos;
	void Start() {
		startTime = Time.time;
		mypos = transform.position;

	}
	void Update() {

		mypos.y += Time.smoothDeltaTime;//.04f;
			mypos.x += Time.smoothDeltaTime;//.04f;
		if(Spawner.startSpawning){
		transform.position = mypos;
		}
		//transform.position = Vector3.MoveTowards(transform.position, target.transform.position, speed*Time.deltaTime);

		//transform.position = new Vector3(mypos.x / puffer.transform.position.x,mypos.y / puffer.transform.position.y,mypos.z / puffer.transform.position.z);
		/*
		//curved trajectories!!!!!!!!!
		Vector3 center = (sunrise.position + sunset.position) * 0.5F;
		center -= new Vector3(0, 1, 0);
		Vector3 riseRelCenter = sunrise.position - center;
		Vector3 setRelCenter = sunset.position - center;
		//float fracComplete = (Time.time - startTime) / journeyTime;
		transform.position = Vector3.Slerp(riseRelCenter, setRelCenter, Time.deltaTime * .02f);//fracComplete
		transform.position += center;
		*/
	}
}